﻿namespace OpenQ.Infrastructure.DomainRepositoryExtensions
{
    using System.Security.Permissions;

    using Repository;
    using DomainObjects;

    //[StrongNameIdentityPermission(SecurityAction.Demand, PublicKey = "0024000004800000940000000602000000240000525341310004000001000100639f96fb72d686c38d8485948b84d5b8fda415c75d005dba502010e7bb5ea007f5933bc6ad986bfa4a768c338be5db87101efd6de5f5a394c3f1994e0e435e0e46f27e4154d3d0cb6c5cd2fda41131999227775c2a50f80200668c82d69546c98618f1065ea5b2f632776fc203949f3f61c07c3860d6d47cf486e9e1df003ab1")]
    public static class CategoryExtension
    {
        public static int GetStoryCount(this ICategory category)
        {
            return IoC.Resolve<IStoryRepository>().CountByCategory(category.Id);            
        }
    }
}
